unit SimplyCipher;

interface

function SimplyEncode(const Key: String; const Value: String): String;
function SimplyDecode(const Key: String; const Value: String): String;

implementation
uses
 IdCoderXXE,
 JvCipher;

function SimplyEncode(const Key: String; const Value: String): String;
 var
  EXX: TIdEncoderXXE;
  VC: TJvVigenereCipher;
begin
 VC:=TJvVigenereCipher.Create(nil);
 EXX:=TIdEncoderXXE.Create(nil);
 Result:=EXX.EncodeString(VC.EncodeString(Key, Value));
 EXX.Free;
 VC.Free;
end;

function SimplyDecode(const Key: String; const Value: String): String;
 var
  DXX: TIdDecoderXXE;
  VC: TJvVigenereCipher;
begin
 VC:=TJvVigenereCipher.Create(nil);
 DXX:=TIdDecoderXXE.Create(nil);
 Result:=VC.DecodeString(Key, DXX.DecodeString(Value));
 DXX.Free;
 VC.Free;
end;

end.
 